package design_pattern.lx2_abstract_factory_pattern;

/**
 * @Author Mr.wang
 * @Description 工厂创造器/生成器类，通过传递形状或者颜色来获取工厂
 * @Date 2020-04-01
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice) {
        if (choice.equalsIgnoreCase("SHAPE")) {
            return new ShapeFactory();
        } else if (choice.equalsIgnoreCase("COLOR")) {
            return new ColorFactory();
        }
        return null;
    }
}
